Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use a disk-persistent cache. #84

Closed
wants to merge 31 commits into from

Conversation

tarruda
Copy link

@tarruda tarruda commented Oct 2, 2013

This should speed up future rebuilds more than the old in-memory cache, as it
will also cache the preprocessed AST and only re-read/parse files that were
modified. The speed gain should be even greater on compile-to-js languages as
recompilation of unmodified files will be completely skipped. Fixes #83.

I've noticed a small speed loss on the first build probably due to stringifying/writing cache to disk, but after that every rebuild is faster than before.

This should speed up future rebuilds more than the old in-memory cache, as it
will also cache the preprocessed AST and only re-read/parse files that were
modified. The speed gain should be even greater on compile-to-js languages as
recompilation of unmodified files will be completely skipped. Fixes michaelficarra#83.
Enabling this option will make commonjs-everywhere replace all module names by a
unique integer id instead of the root-relative path. This will improve
minification a little but will break code that uses __dirname or __filename
(which should not be very common in browser-compatible libraries)
# object whose toString method produces the same output as calling
# toString in the original RegExp object.
node.value = [node.value.toString()]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break any AST-processing code that needs to inspect regexp literals other than calling its 'toString' method

tarruda added 27 commits October 4, 2013 11:25
manual source map computation instead escodegen to generate the final result
handler extensibility to enable usage of input source maps
since its like 10x faster. Also fixed concatenated source map generation
Also by default, dont check if npm modules were changed(very unlikely that npm
modules will change)
a module uses __filename or __dirname a map will be added for that module
self-generated node.js bundle
the actual positions in the result source map
@tarruda
Copy link
Author

tarruda commented Oct 8, 2013

I'm closing some this pull request because I've changed the code too much

@tarruda tarruda closed this Oct 8, 2013
@michaelficarra
Copy link
Owner

Why did you push all of this to master? This could have been useful...

@tarruda
Copy link
Author

tarruda commented Oct 8, 2013

You can still merge if you need, but since I refactored so much I assumed you would not want it

@tarruda
Copy link
Author

tarruda commented Oct 8, 2013

Besides the code kinda dirty, I wasnt careful about code style or organization

@tarruda
Copy link
Author

tarruda commented Oct 8, 2013

I have documented the modifications here: https://github.com/tarruda/powerbuild

It also fixes #79, #63 and my own issue #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve build cache
2 participants